package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.WareHouseRelation;
import com.dc.entity.ro.WareHouseRelationRO;
import com.dc.service.WareHouseRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "危险品出入库管理")
@RestController
@RequestMapping("/wareHouseRelation")
public class WareHouseRelationController {

    @Resource
    private WareHouseRelationService wareHouseRelationService;


    @Log(title = "危险品出入库管理", businessDesc = "出入库")
    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertWareHouseRelation")
    public ResponseResultVO insertWareHouseRelation(@RequestBody WareHouseRelationRO ro) {
        return wareHouseRelationService.insertWareHouseRelation(ro);
    }


    @Log(title = "危险品出入库管理", businessDesc = "修改")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateWareHouseRelation")
    public ResponseResultVO updateWareHouseRelation(@RequestBody WareHouseRelationRO ro) {
        return wareHouseRelationService.updateWareHouseRelation(ro);
    }


    @Log(title = "危险品出入库管理", businessDesc = "删除")
    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteWareHouseRelation")
    public ResponseResultVO deleteWareHouseRelation(@RequestParam String id) {
        return wareHouseRelationService.deleteWareHouseRelation(id);
    }

    @ApiOperation(value = "查询列表", notes = "查询列表")
    @PostMapping("/selectWareHouseRelationList")
    public ResponseResultVO<WareHouseRelation> selectWareHouseRelationList(@RequestBody WareHouseRelationRO ro) {
        return wareHouseRelationService.selectWareHouseRelationList(ro);
    }
}
